# coding=utf-8
import xmlrpclib
import json

url = ':8069'
odooDb = ''
username = '27574520@qq.com'
password = ''

common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
common.version()

uid = common.authenticate(odooDb, username, password, {})

models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))

#product.template

#res = models.execute_kw(odooDb, uid, password,
#    'product.category', 'search_read',
#    [[]],
#    {'fields': ['name', 'parent_id'], 'limit': 999})
#
#for item in res:
#        print item

res = models.execute_kw(
    odooDb, uid, password, 'product.template', 'fields_get',
    [], {'attributes': ['string', 'help', 'type']})

print json.dumps(res, indent=2)
